package com.geovis.emergency.spd.entity.command.enums;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
@JsonFormat(shape = JsonFormat.Shape.STRING)
public enum TfTypeEnum {

    RYRDDY("0", "弱于热带低压"),

    RDDY("1", "热带低压"),

    RDFB("2", "热带风暴"),

    QRDFB("3", "强热带风暴"),

    TF("4", "台风"),

    QTF("5", "强台风"),

    CQTF("6", "超强台风");


    private final String code;
    private final String name;

    /**
     * 获取值
     */
    public static String getNameByCode(String code) {
        for(TfTypeEnum value:values())
        {
            if(value.getCode().equals(code))
            {
                return value.getName();
            }
        }
        return null;
    }

}
